package com.choosefine.it.manager.controller;

import com.choosefine.it.base.BaseController;
import com.choosefine.it.common.def.ResultCode;
import com.choosefine.it.project.model.ProjectManageInfo;
import com.choosefine.it.project.service.ProjectManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 * 项目经理—项目管理
 * 
 * @author Administrator
 * 
 */
@RestController
@RequestMapping("/managerProjectManage")
@Api(value = "项目经理—项目管理", description = "毛俊")
public class ManagerProjectManageController  extends BaseController{
	@Autowired
	ProjectManageService projectManageService;
	
	@ApiOperation(value = "项目经理—项目管理-根据项目经理的usercode查看项目", notes = "金额相关参数未处理", response = ProjectManageInfo.class)
	@ApiImplicitParam(name = "userCode", value = "项目经理的userCode", required = true, dataType = "String", paramType = "path")

	@RequestMapping(value = "/getListByManagerUsercode/{userCode}", method = RequestMethod.GET)
	public String getListByManagerUsercode(@PathVariable String userCode) {
		String result = null;
		if (!StringUtils.isEmpty(userCode)) {
			List<ProjectManageInfo> list = projectManageService.getListByManagerUsercode(userCode);
			result = responseArraySuccess(list, ResultCode.SUCCESS,ResultCode.MSG_SUCCESS);
		} else {
			result = responseFail(ResultCode.FAILED, ResultCode.MSG_PARAMS_NULL);
		}
		return result;
	}
}
